﻿@*YoursLC有源低代码 Create:φ创建者Creatorφ 2022-05-07 19:30:30 添加或编辑-此文件放置于Views/Demo22/中*@

@{ ViewBag.Title = "RDLCReport";
    Layout = "~/Areas/Shared/_LayuiForm.cshtml"; }

@*Demo22数据联动*@
<form class="layui-form" lay-filter="formUser">
    <input style="display:none" id="_listid" value="@ViewBag.ListId">
    <input style="display:none" id="_userid" value="@ViewBag.UserId">
    <input style="display:none" id="_butAtt" value="@ViewBag.ButAtt">
    <div class="layui-form-item" style="text-align: center;">
        <div class="layui-btn-group">
            <a href="" target="_blank" id="pdf" class="layui-btn layui-btn-primary layui-btn-sm">打开PDF</a>
            <a href="" target="_blank" id="excel" class="layui-btn layui-btn-primary layui-btn-sm">导出Excel</a>
            <a href="" target="_blank" id="doc" class="layui-btn layui-btn-primary layui-btn-sm">导出Doc</a>
            <a href="" target="_blank" id="att" class="layui-btn layui-btn-primary layui-btn-sm">@ViewBag.ButAttTxt</a>
        </div>
    </div>
</form>
<script>
    layui.use(["form"], function () {
        let form = layui.form;
        let layer = layui.layer;

        let $ = layui.$;

        setBut();

        function setBut() {
            $("#pdf").attr("href", "/Com/RDLCReport/ExportPdf?listid=" + $('#_listid').val() + "&fwid=bi_Demo22");
            $("#excel").attr("href", "/Com/RDLCReport/ExportXlsx?listid=" + $('#_listid').val() + "&fwid=bi_Demo22");
            $("#doc").attr("href", "/Com/RDLCReport/ExportDocx?listid=" + $('#_listid').val() + "&fwid=bi_Demo22");

            //附件按钮是否可见
            if ($('#_butAtt').val() == '1') {
                $("#att").attr("href", "/Com/FileManage/AttList?listid=" + $('#_listid').val() + "&fwid=bi_Demo22" + "&userid=" + $('#_userid').val());
            }
            else {
                $("#att").hide();
            }
        }
    });
</script>